package com.echo.im.storage.offline.mq;


import com.echo.im.common.model.mq.OfflineMsgMqInfo;
import com.echo.im.mq.contant.QueueConstants;
import com.echo.im.mq.event.receiver.AbstractMessageReceiver;
import com.echo.im.storage.offline.StoreOfflineMessageService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 *
 * @author echo
 * @date 2024-08-13
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class OfflineMessageReceiver extends AbstractMessageReceiver<OfflineMsgMqInfo> {


    private final StoreOfflineMessageService storeOfflineService;

    @Override
    public void doReceive(OfflineMsgMqInfo data) {
        storeOfflineService.storeOfflineMessage(data);
    }


    @Override
    public String getQueueName() {
        return QueueConstants.OFFLINE_MESSAGE_QUEUE;
    }
}
